<html>
<script type="text/javascript"
	src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
	function sayHello() {
		jQuery
				.get(
						"http://localhost:8080/HelloworldRestComponent/Helloworld/sayHello?name=world",
						null, function(data) {
							// alert(data);
							$("result").html(data);
						});
	}

	function sayHi() {
		jQuery
				.post(
						"http://localhost:8080/HelloworldRestComponent/Helloworld/sayHi",
						{
							"name" : "Cash"
						}, function(data) {
							// alert(data);
							$("result").html(data);
						});
	}
</script>

<body>
	<h1>Apache Tuscany Helloworld JAX-RS Sample</h1>

	<p>
		This page uses the Tuscany 'Cross-Origin Resource Sharing' (CORS)
		support to enable calling the Helloworld JAX-RS service with JQuery<br />
		<br /> <a href="#" onclick="sayHello(); return false;">Invoke the
			Helloworld service sayHello</a>
	</p>

	<p>
		<br /> <br /> <a href="#" onclick="sayHi(); return false;">Invoke
			the Helloworld service sayHi</a>
	</p>

	<p>
		<br /> <br /> <div id="result"></div>
	</p>

</body>
</html>